package org.openmore.consumer.service.feignImpl;

import feign.hystrix.FallbackFactory;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.dto.common.ResourcesDto;
import org.openmore.consumer.dto.common.StringParams;
import org.openmore.consumer.entity.enums.ResourceType;
import org.openmore.consumer.service.feign.ResourceService;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;

@Component
public class ResourceServiceImpl extends BaseFeignFallback implements FallbackFactory<ResourceService> {
    @Override
    public ResourceService create(Throwable cause) {
        return new ResourceService() {
            @Override
            public BaseResponse selectAllByPage(String name, String key, ResourceType type, Date startTime, Date endTime, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getResourcesById(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse updateResources(ResourcesDto resources) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse addVideoResources(ResourcesDto resources) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse insertResources(MultipartFile[] files) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse insertResource(MultipartFile file) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getUploadToken() {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse deleteOssResource(StringParams fileName) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse deleteResources(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse downloadResources(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse uploadCallback(String filename, String size, String mimeType, String height, String width) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse parseExcelProducts(MultipartFile file) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse parseExcelModel() {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse test(String str) {
                return getFallBackResponse();
            }
        };
    }
}
